<template>
	<view class="content flex-col">
		<button type="primary" @click="updateImg">上传</button>
		<button type="primary" @click="jump">跳转</button>
	</view>
</template>

<script setup>

import { request, MpReady } from '@/utils/request.js'
import { onLoad, onShow } from '@dcloudio/uni-app'
onLoad( async options => {
	console.log(options)
	MpReady().then(res =>{
		console.log('login', res)
		request({ key : 'getConfig', data : {type : 'CHANNEL'} }).then( res => {
			console.log(res.data)
		})
	})
})

function updateImg() {
	uni.chooseImage({
		count: 3,
		success(res) {
			console.log(res)
			uniCloud.uploadFile({
				filePath: res.tempFilePaths[0],
				cloudPath: 'image/abc.png',
				onUploadProgress(progress) {
					console.log(progress.loaded, progress.total)
				},
				success() {
					console.log('success')
				}
			})
		}
	})
}


function jump(){
	uni.navigateTo({
		url: '/pages/release/release'
	})
}

function handleRegin(res) {
	console.log(res)
}
</script>

<style>

</style>
